Repository navigation
Conversation
On mobile, the "Retry now" button in the connection notice on the terminal, review and file preview screens did nothing for an environment that was switched off: the connection supervisor ignores retries while the environment is disabled. A new useRetryEnvironment hook switches a disabled environment back on instead of retrying it, matching the web fix in pingdotgg#24691, and the three screens use it. A hook test covers both cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Mobile “Retry now” now re-enables a switched-off environment using the existing connection toggle. The change is limited to explicit retry actions and leaves product defaults unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The floating "not connected" pill and the other Reconnect controls called retryNow, which does nothing while the environment is switched off. They now use useRetryEnvironment, the same helper as Retry now on the terminal, review and file preview, so they switch the environment back on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Reconnect pill now calls useRetryEnvironment directly, so its switched-off case is the one useRetryEnvironment.test.tsx already covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Opus 5.5 replying on behalf of Victor. I merged main into this branch because its new commits changed files this PR touches. The merge had no conflicts, and nothing else changed. |
Resolved the import block of apps/mobile/src/features/review/ReviewSheet.tsx by hand: kept main's SheetPane import from pingdotgg#34207 and dropped both the cn import that pingdotgg#34207 removed and the environmentCatalog import that this branch's useRetryEnvironment change left unused.
|
Note 🤖 Opus 5.5 replying on behalf of Victor. I merged main to clear the conflict with #34207. |
Problem
On mobile, an environment switched off in Settings › Environments keeps a way to reconnect on screen: the "
<name>is not connected" pill on a thread, and Retry now on the terminal, review and file preview notices. Tapping it does nothing, because both callretryNowand the supervisor ignores retries while the environment is switched off; the only way out is the switch in Settings.Change
A new
useRetryEnvironmenthook switches a switched-off environment back on withsetEnabled, and otherwise callsretryNowas before. Every mobile reconnect control now goes through it: the sharedonReconnectEnvironmenthandler (thread pill, new-task Reconnect, Settings › Environments, Connections) and the terminal, review sheet and file preview.useConnectionController.retryEnvironmenthad no other caller and is removed.Scope
A bug fix for visible actions that do nothing. It is a very small, focused fix for an obvious bug, so it needs no issue; it changes the mobile app only and makes the same decision as #24691 on web. It also covers the pill fix from #28408, which I closed in favour of this PR so one PR fixes the whole bug.
Verification
maind86ee1e (it includes #34207) and this branch at 339d070 (it merges thatmain), on an iPhone simulator (iOS 26.5) and an Android 16 emulator (arm64, software rendering), against a test server named "Test machine", with taps through the T3 Device panel.For each control: switch Test machine off in Settings › Environments, open the screen by its link, tap the control, then check Settings › Environments. On
mainthe pill or notice stays and the switch stays off. On the branch the screen loads, and the switch is back on and connected. The new hook test passes on the branch and fails withmain's behavior (details).After the tap, iOS:
maind86ee1eNot checked: an environment that can't be switched on (unsupported, no saved route). I read that path in the code but did not run it.
Android, the merge with #34207, method, before the tap, and tests
After the tap, Android:
maind86ee1eThe branch merges
maind86ee1e. The one hand-resolved part is the import block ofReviewSheet.tsx, where #34207 (Android sheets scroll without per-feature platform checks) addedSheetPaneand droppedcn; the merge keeps #34207's import and its restyled sheet, and dropsenvironmentCatalog, which this branch no longer uses there. Against the live head nothing this PR does changes. On the Android emulator the Review changes screen scrolls the same onmainand on the branch: one swipe up on a 124-line diff brings Note line 077 near the top on both (recording onmain, recording on the branch). Both show the same development error toast on that screen ("Maximum update depth exceeded", raised frommain'sReviewSheet.tsxline 585), so it does not come from this change.maind86ee1eProblem and change in full.
On mobile, an environment switched off in Settings › Environments keeps its screens open with a way to reconnect: the floating "
<name>is not connected" pill on a thread, and the Retry now button on the terminal, review and file preview connection notices. Both callretryNow, which does nothing while the environment is switched off, because the supervisor ignores retries until the environment is wanted again. The pill and the notice stay, and the only way out is the switch in Settings.#24691 fixed the same dead button on web and left the mobile notices for later.
A new
useRetryEnvironmenthook infeatures/connectionreads the environment's catalog entry. If the environment is switched off (enabled === false), it switches it back on withsetEnabled. Otherwise it callsretryNowas before. Every mobile reconnect control now goes through it:useRemoteConnections().onReconnectEnvironment, the shared handler behind the thread pill, the new-task Reconnect, Settings › Environments and Connections.retryNowcommand. The file preview still reloads after the tap, as before.useConnectionController.retryEnvironmenthad no other caller and is removed, so the app has one path toretryNowfrom a user action. An environment that can't be switched on (unsupported, with no saved route) fails at once with the existing "environment toggle" error, the same as the Settings switch.Method. Taps went through the T3 Device panel; the Android pill has no accessibility label, so it was tapped at its position. On
mainand the branch, the app was relaunched before the review step, so no diff was cached.Both revisions ran the dev client built for
main's native fingerprint, which the merge shares, with JavaScript served by Metro from each revision's own checkout, against one test server from themaincheckout (the branch changes only the mobile app). The server held a sample project (one uncommitted edit, one image) and finished Replay (dev) threads.For the file preview, the image is opened once while connected, then the environment is switched off and the preview opened again: on today's
maina file screen opened with no session shows "Files unavailable" before it reaches the preview. The switch state after each tap was read in Settings › Environments (off onmain, on with the merge, every control, both platforms).Before the tap on the branch (on
mainthe screens look the same before and after):The hook test on
maind86ee1e with only the missing hook added as a stub that callsretryNow, asmain's controls do:On this branch (339d070):
Earlier runs on
main7462f23 (head 0e8284b, merge 3e094786db; iPhone 17 Pro simulator, iOS 26.5, and an Android 15 emulator, Pixel 7 profile, arm64, SwiftShader software rendering) and onmainf419698 (merge ca212c1) showed the same.mainhas since changedReviewSheet.tsx(#34207), so those captures are not reused.Prior PRs
#24691 by Jacksondr5 fixed this on web and left these mobile notices for later. #28408, also mine, carried the pill half and is folded into this PR.
#5599 and then #5598 (DominicVonk) included this same action: tap the red composer status to switch a disabled environment on. #5599 closed in favour of #5598, which closed for its much broader availability model. The enabled flag and commands this fix uses landed later in #11478.
Generated with Claude Opus 5.5 and GPT-6.1 Terra in T3 Code Nightly